package com.abner.design.patterns.command;

/**
 * 将一个接受者对象与一个命令绑定，调用接受者相应的操作，实现 execute
 *
 * @author abner
 */
public class LightOffCommand implements Command {

    LightReceiver light;

    public LightOffCommand(LightReceiver light) {
        super();
        this.light = light;
    }

    @Override
    public void execute() {
        light.off();
    }

    @Override
    public void undo() {
        light.on();
    }
}
